package com.module.product;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;

import base.util.ConstantUnit;
import base.util.Page;
import base.util.StringUtil;

import com.module.product.vo.ProductGroup;
import com.module.sys.LoginSession;

public class ProductGroupService {
	 /*
	 public Page list(ProductGroup obj,Integer start,Integer limit) throws Exception{
	  	Page page = new Page();
	  	page.setStart(start);
   	    page.setLimit(limit);
        Map map = new HashMap();
	    map.put(ConstantUnit.O_PT, EnumOpt.ProductGroup_list.toString());
	    map.put("page", page);
	    map.put("productGroup", obj);
	    return ProductSocketClient.returnValue(map).getPage();
		}
	


		
	 public ProductGroup findbyid(String id)
	 {
	    try {
			    Map map = new HashMap();
		 	    ProductGroup obj =new ProductGroup();
		 	    obj.setId(id);
		  	    map.put(ConstantUnit.O_PT, EnumOpt.ProductGroup_findbyid.toString());
		  	    map.put("productGroup", obj);
		  	    ProductGroup m =ProductSocketClient.returnValue(map).getProductGroup();
				return m;
			} catch (Exception e) {
				
				e.printStackTrace();
				return null;
			}
	 }
	 
	 
	 public Map save(ProductGroup obj)
	 {
	  try {
		  
		    if(StringUtils.isBlank(obj.getId()))//添加
			{
		    	obj.setCreaterId(LoginSession.getUserid());
			}else//修改
			{
				obj.setUpdaterId(LoginSession.getUserid());
			}
			    Map map = new HashMap();
		  	    map.put(ConstantUnit.O_PT,EnumOpt.ProductGroup_save.toString());
		  	    map.put("productGroup", obj);
				return ProductSocketClient.returnValue(map).getResult();
			} catch (Exception e) {
				
				e.printStackTrace();
				return null;
			}
	 } 
	 
	 
	 public Map remove(List<String> idArray) throws Exception{
		 String ids = StringUtil.getNewStrByList(idArray);
		    ProductGroup obj = new ProductGroup();
		              obj.setId(ids);
		              obj.setUpdaterId(LoginSession.getUserid());
		    Map map = new HashMap();
	  	    map.put(ConstantUnit.O_PT,EnumOpt.ProductGroup_delete.toString());
	  	    map.put("productGroup", obj);
			return ProductSocketClient.returnValue(map).getResult();  
	 }
	 
	 
	
	*/

}
